#include<stdio.h>


//实现了打印的通用性，每次打印只需传入变量和打印格式即可
#define print_format(num, format)   \
            printf("the value of " #num " is " format, num)
//#num 的作用是先让num的值被替换，再转成字符串形式
//如果直接写成"num"，是不行的，编译器不会把num替换成传入的值，只会原样输出，输出num

int main()
{
    int a = 0;
    float b = 3.14;
    print_format(a, "%d\n");
    //printf("the value of a is %d", a);
    print_format(b, "%f\n");
    //printf("the value of b is %lf", b);
    return 0;
}

